package com.alcloud.springplus.domain;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @className: Role
 * @description: 角色表
 * @author: AllG
 * @createDate: 2018-11-19 10:08:02
 * @updateRemark: 更新说明
 */
@Data
@Entity
@Table(name = "t_role")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 主键Id
     */
    @Id
    @Column(name = "f_role_id", unique = true, nullable = false)
    @TableGenerator(name = "table_seq", pkColumnValue = "t_role", initialValue = 1, allocationSize = 10)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "table_seq")
    private Integer id;

    /**
     * 角色名称
     */
    @Column(name = "f_name", nullable = false, length = 100)
    private String name;

    /**
     * 角色编码
     */
    @Column(name = "f_code", nullable = false, length = 50)
    private String code;

    /**
     * 角色描述
     */
    @Column(name = "f_description", length = 255)
    private String description;

    /**
     * 排序
     */
    @Column(name = "f_seq")
    private Integer seq;

    /**
     * 功能权限
     */
    @Column(name = "f_perms", length = 16777215)
    private String perms;

    /**
     * 是否拥有所有功能权限
     * 1: 代表是
     * 0：代表否
     */
    @Column(name = "f_is_all_perm")
    private Integer isAllPerm;

    /**
     * 角色状态
     * 0：启用
     * 1：停用
     */
    @Column(name = "f_status")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(name = "f_create_time")
    @CreationTimestamp
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "f_create_by")
    private Integer createBy;

    /**
     * 更新时间
     */
    @Column(name = "f_update_time")
    private Date updateTime;

    /**
     * 更新人
     */
    @Column(name = "f_update_by")
    private Integer updateBy;
}
